package com.zpark.web.filter;

import javax.servlet.*;
import java.io.IOException;

public class MyFilter02 implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.err.println("MyFilter02过滤器初始化成功");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.err.println("请求经过过滤器MyFilter02");
        // 放行，访问后续资源
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        System.err.println("MyFilter02过滤器销毁");
    }
}
